package com.whm.hrmanagement.controller;

import com.whm.common.core.controller.BaseController;
import com.whm.common.core.domain.AjaxResult;
import com.whm.hrmanagement.domain.dto.OaMenHuHead;
import com.whm.hrmanagement.domain.dto.OaMenhuBarDate;
import com.whm.hrmanagement.domain.dto.OaMenhuPieDate;
import com.whm.hrmanagement.service.IOaMenhuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/hrmanagement/Menhu")
public class OaMenhuController extends BaseController {
    @Autowired
    private IOaMenhuService iOaMenhuService;

    /**
     * 查询员工head表格
     */
    @GetMapping("/attendance")
    public AjaxResult getAttendanceData(@RequestParam Long id, String month) {
        return success(iOaMenhuService.getAttendanceData(id, month));
    }
    @GetMapping("/Head")
    public AjaxResult head()
    {

        OaMenHuHead oaMenHuHead = iOaMenhuService.getHead();
        return success(oaMenHuHead);
    }
    @GetMapping("/pie")
    public AjaxResult getPieData()
    {

        List<OaMenhuPieDate> oaMenhuPieDates = iOaMenhuService.getPieData();
        return success(oaMenhuPieDates);
    }
    @GetMapping("/bar")
    public AjaxResult getBarData()
    {

        List<OaMenhuBarDate> oaMenhuBarDates = iOaMenhuService.getBarData();
        return success(oaMenhuBarDates);
    }

}
